package com.example.crossborderecommerce.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.crossborderecommerce.entity.Admin;
import com.example.crossborderecommerce.entity.ProductCategory;
import com.example.crossborderecommerce.entity.Store;
import com.example.crossborderecommerce.entity.StoreCommodity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Yolanda
 * @since 2024-05-09
 */
@Mapper
public interface StoreCommodityMapper extends BaseMapper<StoreCommodity> {
    public List<StoreCommodity> getStoreCommodityByPage(Page<StoreCommodity> page,
                                                          @Param("productName") String productName,
                                                          @Param("storeId") String storeId,
                                                          @Param("status") String status);
    public Store findStoreByCommodityId(String storeCommodityId);

    public StoreCommodity findByStoreIdProductId(String storeId,String produceId);

    public Integer findStoreCommodityByType(String type);
    public Integer findCategoryCountByType(String type);
    public Integer findStoreCommodityCountByStatus(String status);

    public Integer findNormalCountByType(String type);
    public Integer findLackCountByType(String type);
    public Integer findEmptyCountByType(String type);
}
